{extend name="public/base"/} 
{block name="body"}
<style>
.mui-table-view-cell p {    
	margin-bottom: 0;    
	font-size: 12px;}
.mui-table-view .mui-media-object {    
	line-height: 42px;    
	width: 60px !important;        
	max-width: 60px;    
	height: 60px;}
.mui-card-header {    
	font-size: 12px;    
	border-radius: 2px 2px 0 0;        
	padding: 5px 10px;}
	</style>
<header class="mui-bar mui-bar-nav">  
	<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>    
	<h1 class="mui-title">蔬菜查询</h1>   
	</header>
	<div class="mui-content" style="    margin-bottom: 100px;">				
		<div>			
			<form method="get">				
				<div>					
				输入菜名：<input type="text" class="form-control" name="scname" value="{$Think.get.remarkbak}" placeholder="请输入蔬菜名字">
               <div>							  
               	<!--				    <input type="radio" name="fhren" value="1">四建                    <input type="radio" name="fhren" value="2">保健院-->				
               </div>					              					 
               <button class="btn btn-primary" type="submit">搜索</button>				
               </div>			
               <div> 				
            </form>
            {if condition="$dlproxy gt 5"}     
            <div class="mui-col-xs-4 mui-text-right">
            <a href="javascript:;" data-toggle="modal" data-target="#myModal2">添加商品</a></div>     {/if}      
            <div class="modal fade "  id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">        
            	<div class="modal-dialog modal-sm">          
            		<div class="modal-content">            
            			<div class="modal-header">              
            				<button type="button" class="close" data-dismiss="modal">
            				<span aria-hidden="true">&times;</span>
            				<span class="sr-only">Close</span></button>              
            				<h4 class="modal-title" id="myModalLabel">运费详细情况</h4>            
            				</div>						
            				<form class="form-horizontal2" action="{:url('index/goodshops/shucaiinsert')}" method="post">	            
            		<div class="modal-body">	            	
            			<!--<div>商品编号：<input type="text" name="yunfei"/></div>-->	            	
            			<div>编号：<input type="text" name="bianhao"  style=" width: 100px;text-align: center;" /></div>	                
            			<div>商品名称：<input type="text" name="shucainame"  style=" width: 100px;text-align: center;" /></div>	
            			<div>商品规格：<input type="text" name="guige"  style=" width: 100px;text-align: center;" /></div>
            			<div>商品1类价格：<input type="number" step="0.01" name="priceone"  style=" width: 100px;text-align: center;" />元</div>					
            			<div>商品2类价格：<input type="number" step="0.01"  name="pricetwo"  style=" width: 100px;text-align: center;" />元</div>																															
            			<input type="hidden" name="id" value="">	            </div>	            <div class="modal-footer">	              
            				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>	              
            				<button type="submit" class="btn btn-primary submit-btn ajax-post"  target-form="form-horizontal2">确定</button>	            
            		</div>						
            		</form>          
            		</div>        
            		</div>      
            		</div>      
            		<!--显示模态框-->			
            		<script>						 
            		$(function(){				 
            			$('#myModal2').on('show.bs.modal', function (e) {
            			 })			
            			 })			
            	</script>													
            	</div>			
            	</form>		
            	</div>				
            	<div>                                    
            		</div>            
            		{if condition="$dlproxy gt 2"}      
            		<div>      	
            			<span>1类价格目前配送的所有公司蔬菜 (华夏幼儿园 华通 铁搭省公司 艾登酒店 和悦酒店 第十幼儿园 贵州银行)</span>
            			</br>      	
            			<span>2类价格胡桃里水果价格(世纪城幼儿园 大营坡幼儿园 胡桃里)</span>  
            			</br>      	
            			<span>3类价格</span>     
            			</div>		
            			<table class="table">                        
            				<thead>                          
            					<tr>                                                     
            						<th width="100">商品编号</th>                            
            						<th width="40%">商品名称</th>                            
            						<th width="10%">规格</th>                            
            						<th width="20%">1类价格</th>                            
            						<th width="20%">2类价格</th> 
            						<th width="20%">3类价格</th>                                                   
            					</tr>                        
            					</thead>                       
            					{volist name="dllist" id="vo"}                          
            					<tr>																		
                                <td>{$vo.bianhao}</td>														
                                <td><a href="javascript:;" 
				 					data-toggle="modal" 
				 					data-target="#myModal5"  				 					
				 					data-id="{$vo['id']}" 
				 					
				 					data-price1="{$vo['price1']}" 
				 					data-price2="{$vo['price2']}"
				 					data-shucainame="{$vo['shucainame']}"
				 					>{$vo.shucainame}</a></td>													
                                <td>{$vo.danwei}</td>														
                                <td>{$vo.price1}</td>														
                                <td>{$vo.price2}</td>	
                                <td>{$vo.price3}</td>																										
                                </tr>													                      
                                {/volist}                      
                                </table>{/if}</div>
                                
    <div class="modal fade "  id="myModal5" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-sm">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
              <h4 class="modal-title" id="myModalLabel">修改商品价格和库存</h4>
            </div>
						<form class="form-horizontal2" action="{:url('index/goodshops/editShucai')}" method="post">
	            <div class="modal-body">	            	
												<!--<div>商品编号：<input type="text" name="yunfei"/></div>-->	            	
												               
												<div>商品名称：<input type="text" disabled="disabled" name="xgshucainame"  style=" width: 100px;text-align: center;" /></div>
											<div>商品价格1：<input type="number" step="0.01" name="price1"  style=" width: 100px;text-align: center;" />元</div>					
											<div>商品价格2：<input type="number" step="0.01" name="price2"  style=" width: 100px;text-align: center;" />元</div>					
											
				                            
				<input type="hidden" name="id" value="">
	            </div>
	            <div class="modal-footer">
	              <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	              <button type="submit" class="btn btn-primary submit-btn ajax-post"  target-form="form-horizontal2">确定</button>
	            </div>
						</form>
          </div>
        </div>
      </div>
			<script>
			 $(function(){
				 $('#myModal5').on('show.bs.modal', function (e) {
				 	
						var id = $(e.relatedTarget.outerHTML).attr('data-id');
						var price1 = $(e.relatedTarget.outerHTML).attr('data-price1');
						var price2 = $(e.relatedTarget.outerHTML).attr('data-price2');
						
						
						var shucainame = $(e.relatedTarget.outerHTML).attr('data-shucainame');
						$(e.target).find('[name="id"]').val(id);
						
						$(e.target).find('[name="xgshucainame"]').val(shucainame);
						$(e.target).find('[name="price1"]').val(price1);
						$(e.target).find('[name="price2"]').val(price2);
						
						
						
				 })
			 })
			</script>
{/block}

